import { defineStore } from 'pinia'
 

export const useLicenseStore = defineStore('licensePath', { 
    state: () => ({
        auth:false,//强制要求
        license:false,//强制要求
        offline:false,//支持离线版
        licenseInfo: {}, 
        url:"",
        // "themePage": "/orgtheme",  
        // showBack:true,//大屏显示返回
        "themePage": "/theme",  
        showBack:false,//大屏显示返回
    }),
    actions: {
        setLicenseInfo(data) {
            this.licenseInfo = data
        },
        setUrl(url) {
            this.url = url
        },
        getAuth() {
            if(!this.licenseInfo||!this.licenseInfo.id){
                return false;
            }
            if(this.licenseInfo.status=='-1'){
                return false
            }
            if(this.licenseInfo.expireTime<=new Date().getTime()){
                return false;
            }else{
                return true
            } 
            return false;

        }, 
    }
})